package com.cysoft.matrix.application;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import java.util.Map;

import io.flutter.embedding.android.FlutterActivity;

public class RouterUtil {
    public static boolean openPageByUrl(Context context, String url, Map params, int requestCode) {

        // .... 省略

        try {
//            if (pageName.containsKey(path))
            {
                Intent intent = FlutterActivity.createDefaultIntent(context);
                if(context instanceof Activity){
                    Activity activity=(Activity)context;
                    activity.startActivityForResult(intent,requestCode);
                }else{
                    context.startActivity(intent);
                }
                return true;
//            } else {
                // .... 省略
            }

//            return false;

        } catch (Throwable t) {
            return false;
        }
    }
}
